const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    showm:1,
    model: 1,
    member:'',
    baseImgUrl:app.globalData.baseImgUrl
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    console.log(options)
    if(options.showm==0){
      this.setData({
        showm:options.showm
      })
    }
    let model = wx.getStorageSync('model')
    if (model) {
      this.setData({
        model
      })
    }
    this.setData({
      member: wx.getStorageSync('member')
    })
  },


  toGoods(){
    if(!!this.data.member){
      wx.navigateTo({
        url: '/pages/new_index/market_goods/market_goods',
      })
    }else{
      wx.showModal({
        showCancel: false,
        content: '您不是本村村民，暂无权限！',
      })
    }
  },


  toPic(){
    if(!!this.data.member){
      wx.navigateTo({
        url: '/pages/new_index/chat_pic/chat_pic',
      })
    }else{
      wx.showModal({
        showCancel: false,
        content: '您不是本村村民，暂无权限！',
      })
    }
  },

  toVideo() {
    if (!!this.data.member) {
      wx.navigateTo({
        url: '/pages/new_index/chat_video/chat_video',
      })
    } else {
      wx.showModal({
        showCancel: false,
        content: '您不是本村村民，暂无权限！',
      })
    }
  }
})